Skip to content

Feat: Support basic Symbol navigation inside AI coding session#258

Merged
tninja merged 15 commits intomainfrom
kang_feat_1
Mar 22, 2026
Merged

Feat: Support basic Symbol navigation inside AI coding session#258
tninja merged 15 commits intomainfrom
kang_feat_1

Conversation

@tninja
Copy link
Copy Markdown
Owner

@tninja tninja commented Mar 22, 2026

This is an improvement on top of existing file path & url navigation #249

It will try 1. LSP; 2. xref; 3. helm-gtags to navigate

Verified that both vterm and eat backends works.

screenshot:

Screenshot from 2026-03-22 08-08-07

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds basic symbol linkification + navigation to AI session buffers, building on the existing in-repo file/URL link support so users can jump from agent output to relevant code locations more directly.

Changes:

  • Linkify “symbol-like” tokens appearing near a resolved file link and make them clickable with dedicated keybindings.
  • Add navigation commands to open the associated file link and then resolve the symbol via xref, helm-gtags, or buffer search.
  • Extend ai-code--explain-dired to include context for multiple selected files/directories.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
ai-code-session-link.el Adds symbol candidate detection, properties/keymap, and navigation commands integrated into session linkification.
test/test_ai-code-session-link.el Adds ERT coverage for symbol linkification behavior and symbol navigation fallbacks.
ai-code-discussion.el Updates Dired explain prompt generation to handle multiple selections and format multi-file context.

Comment on lines 270 to +276
(let* ((file-at-point (dired-get-filename nil t))
(git-relative-path (when file-at-point
(car (ai-code--get-git-relative-paths (list file-at-point)))))
(files-context-string (when git-relative-path
(concat "\nFiles:\n@" git-relative-path)))
(all-marked (dired-get-marked-files))
(has-marked-files (> (length all-marked) 1))
(context-files (if has-marked-files
all-marked
(when file-at-point
(list file-at-point))))
Copy link

Copilot AI Mar 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dired-get-marked-files is now called unguarded. In Dired, this can signal an error when point is not on a file line (e.g., header/subdir lines), which would regress the previous behavior that handled nil from dired-get-filename gracefully. Consider wrapping the call in ignore-errors and/or using the existing “explicit marks” detection pattern used elsewhere (e.g., treat a single entry equal to file-at-point as ‘no explicit marks’) so the command doesn’t error and also supports a single explicitly-marked file.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 03e1ed97c1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@tninja tninja merged commit 2ecd8c7 into main Mar 22, 2026
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants